#ifndef COMMUNICATION_H
#define COMMUNICATION_H

#include <QWidget>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
#include <QLabel>
#include <QTextEdit>
#include <QTcpSocket>
#include <QMap>

class Communication : public QWidget {
    Q_OBJECT

public:
    Communication(QTcpSocket *socket, QWidget *parent = nullptr);

private slots:
    void onSendButtonClicked();
    void onBackButtonClicked();
    void onReadyRead();

private:
    void setInputFieldStyle(QLineEdit *lineEdit);
    QPushButton* createStyledButton(const QString &text, const QString &color);

    QLineEdit *questionEdit;
    QTextEdit *chatDisplay;
    QTcpSocket *tcpSocket;
};

#endif // COMMUNICATION_H
